package cn.iocoder.yudao.module.activity.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.activity.entity.ActivityDO;
import cn.iocoder.yudao.module.activity.vo.ActivityPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 招聘活动 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ActivityMapper extends BaseMapperX<ActivityDO> {

    default PageResult<ActivityDO> selectPage(ActivityPageReqVO activityPageReqVO) {
        return selectPage(activityPageReqVO, new LambdaQueryWrapperX<ActivityDO>().likeIfPresent(ActivityDO::getActivityName, activityPageReqVO.getActivityName()).eqIfPresent(ActivityDO::getCompanyId, activityPageReqVO.getCompanyId()).likeIfPresent(ActivityDO::getCompanyName, activityPageReqVO.getCompanyName()).betweenIfPresent(ActivityDO::getStartTime, activityPageReqVO.getStartTime()).betweenIfPresent(ActivityDO::getEndTime, activityPageReqVO.getEndTime()).eqIfPresent(ActivityDO::getRegistrationStart, activityPageReqVO.getRegistrationStart()).eqIfPresent(ActivityDO::getRegistrationEnd, activityPageReqVO.getRegistrationEnd()).eqIfPresent(ActivityDO::getProvinceCode, activityPageReqVO.getProvinceCode()).likeIfPresent(ActivityDO::getProvinceName, activityPageReqVO.getProvinceName()).eqIfPresent(ActivityDO::getCityCode, activityPageReqVO.getCityCode()).likeIfPresent(ActivityDO::getCityName, activityPageReqVO.getCityName()).eqIfPresent(ActivityDO::getDistrictCode, activityPageReqVO.getDistrictCode()).likeIfPresent(ActivityDO::getDistrictName, activityPageReqVO.getDistrictName()).eqIfPresent(ActivityDO::getAddress, activityPageReqVO.getAddress()).eqIfPresent(ActivityDO::getLongitude, activityPageReqVO.getLongitude()).eqIfPresent(ActivityDO::getLatitude, activityPageReqVO.getLatitude()).eqIfPresent(ActivityDO::getContactPerson, activityPageReqVO.getContactPerson()).eqIfPresent(ActivityDO::getContactPhone, activityPageReqVO.getContactPhone()).eqIfPresent(ActivityDO::getContactEmail, activityPageReqVO.getContactEmail()).eqIfPresent(ActivityDO::getImages, activityPageReqVO.getImages()).eqIfPresent(ActivityDO::getDescription, activityPageReqVO.getDescription()).eqIfPresent(ActivityDO::getRemark, activityPageReqVO.getRemark()).eqIfPresent(ActivityDO::getStatus, activityPageReqVO.getStatus()).eqIfPresent(ActivityDO::getMaxParticipants, activityPageReqVO.getMaxParticipants()).eqIfPresent(ActivityDO::getCurrentParticipants, activityPageReqVO.getCurrentParticipants()).eqIfPresent(ActivityDO::getViewCount, activityPageReqVO.getViewCount()).eqIfPresent(ActivityDO::getIsFeatured, activityPageReqVO.getIsFeatured()).eqIfPresent(ActivityDO::getCreator, activityPageReqVO.getCreator()).betweenIfPresent(ActivityDO::getCreateTime, activityPageReqVO.getCreateTime()).eqIfPresent(ActivityDO::getCreator, activityPageReqVO.getUpdater()).orderByDesc(ActivityDO::getId));
    }

}